//
//  SendGroupMessagebottomView.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/20.
//

#import "SendGroupMessagebottomView.h"

@implementation SendGroupMessagebottomView


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{
    
    UIView *backview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 300)];
    backview.backgroundColor = [UIColor whiteColor];
    [self addSubview:backview];

    UIView *myDataLineV = [[UIView alloc]initWithFrame:CGRectMake(15, 15, 3, 15)];
    myDataLineV.backgroundColor = rgba(22, 120, 255, 1);
    myDataLineV.layer.cornerRadius = 2;
    [backview addSubview:myDataLineV];
    UILabel *myDataLab = [[UILabel alloc]initWithFrame:CGRectMake(myDataLineV.frame.size.width+myDataLineV.frame.origin.x+5,15, 70, 15)];
    myDataLab.text = @"选择模板";
    myDataLab.textColor = [UIColor blackColor];
    myDataLab.textAlignment = 0;
    myDataLab.font = [UIFont systemFontOfSize:16 weight:bold];
    [backview addSubview:myDataLab];

    NSArray *AdmissionsServicesArr = @[@"招约课通知",@"春节短信",@"端午问候",@"中秋问候",@"日常练车",@"+ 新增"];
    CGFloat btnW = (APPwidth-55)/3;
    CGFloat btnH = 30;
    for (int i = 0; i < AdmissionsServicesArr.count; i++) {
        NSInteger row = i/3;
        NSInteger col = i%3;
        CGFloat btnX = 15 + (btnW + 15 ) * col;
        CGFloat btnY = 15 + (btnH + 15 ) * row;
        
        UIButton *AdmissionsServicesBtn =[UIButton buttonWithType:UIButtonTypeCustom];
        AdmissionsServicesBtn.frame = CGRectMake(btnX,btnY+myDataLab.frame.size.height+myDataLab.frame.origin.y+10, btnW, btnH);
        [AdmissionsServicesBtn setTitle:AdmissionsServicesArr[i] forState:0];
        AdmissionsServicesBtn.titleLabel.textAlignment = 1;
        AdmissionsServicesBtn.titleLabel.font = [UIFont systemFontOfSize:13];
        AdmissionsServicesBtn.layer.cornerRadius = 15;
        [AdmissionsServicesBtn setBackgroundColor:rgba(245, 245, 250, 1)];
        AdmissionsServicesBtn.titleLabel.textAlignment = 1;
        AdmissionsServicesBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        [AdmissionsServicesBtn setTitleColor:[UIColor blackColor] forState:0];
        [backview addSubview:AdmissionsServicesBtn];
        
    }
    
    
    UIButton *sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2-328/2, backview.height-100, 328, 45)];
    [sendBtn setTitle:@"发送" forState:0];
    sendBtn.titleLabel.textAlignment = 1;
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [sendBtn setTitleColor:[UIColor whiteColor] forState:0];
    sendBtn.layer.cornerRadius = 45/2;
    [sendBtn setBackgroundColor:rgba(22, 120, 255, 1)];
    [backview addSubview:sendBtn];
    
    
    
    
}

@end
